package com.cn.springcloudwechat.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * 订单util
 * @author: Administrator
 * @create: 2018/8/13 16:03
 */

public class OrderUtil {
    /**
     * 获取商户订单号
     * @return
     */
    public static  String getOutTradeNo() {
        // 设置日期格式
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
        // new Date()为获取当前系统时间
        String   outTradeNo = df.format(new Date());
        outTradeNo = outTradeNo + (UUID.randomUUID().toString().trim().replaceAll("-", "").substring(0, 13));
        return outTradeNo;
    }


}
